package com.itlong.cloud.app.resource;

import com.itlong.cloud.app.service.IAppCloudElevatorCallStatusService;
import com.itlong.cloud.equip.app.IAppCloudElevatorCallStatusServiceClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      用户呼梯状态业务处理暴露接口实现类
 * </desc>
 *
 * @createDate 2018/04/13
 */
@RestController
public class AppCloudElevatorCallStatusServiceResource implements IAppCloudElevatorCallStatusServiceClient{
    @Autowired
    IAppCloudElevatorCallStatusService iAppCloudElevatorCallStatusService;

    /**
     * <desc>
     *      删除一天前的电梯状态
     * </desc>
     *
     * @return
     * @author Jiaqi.X
     * @createDate 2018/04/13
     */
    @RequestMapping(value = "/app/callState/deleteYestodayCallStatus",method = RequestMethod.POST)
    @Override
    public Integer deleteYestodayCallStatus(){
        return iAppCloudElevatorCallStatusService.deleteYestodayCallStatus();
    }

    /**
     * <desc>
     *      将所有超过10分钟都没有预约完成的电梯状态修改为呼梯失败
     * </desc>
     *
     * @return
     * @author Jiaqi.X
     * @createDate 2018/04/13
     */
    @RequestMapping(value = "/app/callState/setCallStatusAsCallDefeat",method = RequestMethod.POST)
    @Override
    public Integer setCallStatusAsCallDefeat(){
        return iAppCloudElevatorCallStatusService.setCallStatusAsCallDefeat();
    }

    /**
     * <desc>
     *      冷表数据转移
     * </desc>
     *
     * @createDate 2020/04/13
     * @author Jiaqi.X
     */
    @RequestMapping(value = "/app/callState/coldDataRemove",method = RequestMethod.POST)
    public void coldDataRemove() throws Exception{
        iAppCloudElevatorCallStatusService.coldDataRemove();
    }
}
